﻿using UnityEngine;
using System.Collections;

public class Plane : MonoBehaviour {

	// Use this for initialization

	public int maxHp;
	private int hp;
	public GameObject explosionFX;


protected virtual	void Start () {
		hp = maxHp;
	}
	
	// Update is called once per frame
	protected virtual	void GetHurt (int value) {
		hp = value;
		if(hp<=0)
		{

			Die ();

		}
}

	void Die()

	{
		Instantiate (explosionFX, transform.position, transform.rotation);
		Destroy(this.gameObject);
	}
}

